<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>专科小组</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../common/mui/mui.min.css">
		<link rel="stylesheet" href="../../common/css/publicStyle.css">
		<link rel="stylesheet" href="nurseGroup.css" />
		<style>

		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<div id="navimg" style="text-align: center;"><img src="../../common/images/logo-white.png" width="130px"
					height="20px">
			</div>
		</header>
		<div class="mui-content">
			<div class="mui-slider-group" style="background-color: #fff;">
				<div class="mui-slider-item" style="background-color: #fff;">
					<ul id="groupTable" class="mui-table-view mui-grid-view mui-grid-9"
						style="background-color: #fff;">
						<!-- <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
							<img src="../images/pumch.jpg" alt="" class="cellImg">
							<div class="cellTitle mui-media-body">小组</div>
						</li> -->
					</ul>
				</div>
			</div>
		</div>

		<script src="../../common/mui/mui.min.js"></script>
		<script src="../../common/js/h5adapter.js"></script>
		<!--<script src="../js/globalDatas.js"></script>-->
		<script>
			var jsonData = [];
			mui.init({
				swipeBack: false //启用右滑关闭功能
			});
			mui.plusReady(function() {
				plus.navigator.setStatusBarBackground('#24af96');
				plus.navigator.setStatusBarStyle('light');
				
				var _self = plus.webview.currentWebview();
				_self.setStyle({
					popGesture: 'none'  // 作用于ios 禁止右滑关闭
				});
				mui.back = function() {
					plus.navigator.setStatusBarBackground('#fff')
					plus.navigator.setStatusBarStyle('dark');
					_self.close("auto");
				}
				getServerJsonData()
			});

			/*
			 * 请求json数据
			 */
			function getServerJsonData() {
				var result = {
					"nurseGroup": [{
						"name": "静脉血栓小组"
					}, {
						"name": "管路小组"
					}, {
						"name": "气道小组"
					}, {
						"name": "静脉治疗小组"
					}, {
						"name": "压疮小组"
					}, {
						"name": "缓和小组"
					}, {
						"name": "疼痛小组"
					}, {
						"name": "糖尿病小组"
					}, {
						"name": "老年小组"
					}, {
						"name": "内镜护理小组"
					}, {
						"name": "营养管理小组"
					}, {
						"name": "循证护理小组"
					}, {
						"name": "消毒供应小组"
					}, {
						"name": "重症护理小组"
					}]
				}
				jsonData = result.nurseGroup;
				updateTabelWithJsonData(jsonData);
			}

			function updateTabelWithJsonData(json) {
				var groupTable = document.getElementById('groupTable');
				for (var i = 0; i < json.length; i++) {
					var liEl = document.createElement('li');
					liEl.setAttribute("class", "mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4");

					var groupImage = document.createElement('img');
					groupImage.setAttribute("class", "cellImg");
					groupImage.setAttribute('src', '../../common/images/pumch.jpg');
					liEl.appendChild(groupImage);

					var textDiv = document.createElement('div');
					textDiv.setAttribute("class", "cellTitle mui-media-body");
					textDiv.innerText = json[i].name;
					liEl.appendChild(textDiv);
					groupTable.appendChild(liEl);
					liEl.addEventListener('tap', oneLiTapped, false);
				}
			}

			function oneLiTapped() {
				var titleEl = this.querySelector('.mui-media-body');
				var titleStr = titleEl.innerText;
				var subPage = [{'title': '文档',id: "sub1.html",url: "fileListSub.html",
						extras: {'category':'专科小组/'+titleStr+'/文档'}},
					{'title': '视频',id: "sub2.html",url: "fileListSub.html",
						extras: {'category': '专科小组/'+titleStr+'/视频'}},
					{'title': '图片',id: "sub3.html",url: "fileListSub.html",
						extras: {'category': '专科小组/'+titleStr+'/图片'}}]
				var webview = mui.openWindow({
					url: '../fileList/fileListP.html',
					id: '../fileList/fileListP.html',
					extras: {'subPage':subPage,'from':'group'},
					waiting: {
						autoShow: false, //自动显示等待框，默认为true
					}
				});
			
			}
		</script>
	</body>

</html>
